<%@ page language="java" import="com.gin.util.*" pageEncoding="UTF-8" %>
<%@ page language="java" import="java.util.*" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="ssm" uri="http://ssm" %>
<%@ include file="/head.jsp" %>


<div>
 <div class="panel panel-default">
  <div class="panel-heading">
   <span class="titles"> 试题查询 </span>
  </div>
  <div class="panel-body">
   <div class="form-search pa10 bg-warning">
    <form class="form-inline" action="?" size="small" id="formSearch">
     <!-- form 标签开始 -->

     试卷编号： <input type="text" class="form-control" style="" name="shijuanbianhao" value="${param.shijuanbianhao}" />

     试卷名称： <input type="text" class="form-control" style="" name="shijuanmingcheng" value="${param.shijuanmingcheng}" />

     所属科目：
     <select class="form-control class_suoshukemu4" data-value="${param.suoshukemu}" id="suoshukemu" name="suoshukemu">
      <option value="">请选择</option>
      <ssm:sql var="select" type="select">SELECT * FROM kemu ORDER BY id desc</ssm:sql>
      <c:forEach items="${select}" var="m">
       <option value="${m.id}">${m.kemumingcheng}</option>
      </c:forEach>
     </select>
     <script>
      $(".class_suoshukemu4").val($(".class_suoshukemu4").attr("data-value"));
     </script>

     课程名称： <input type="text" class="form-control" style="" name="kechengmingcheng" value="${param.kechengmingcheng}" />

     章节名称： <input type="text" class="form-control" style="" name="zhangjiemingcheng" value="${param.zhangjiemingcheng}" />

     类型：
     <select class="form-control select-update" data-value="${param.leixing}" id="leixing" name="leixing">
      <option value="">请选择</option>
      <option value="单选题">单选题</option>
      <option value="多选题">多选题</option>
      <option value="判断题">判断题</option>
      <option value="填空题">填空题</option>
      <option value="简答题">简答题</option>
     </select>
     <script>
      $(".class_leixing5 select-update").val($(".class_leixing5 select-update").attr("data-value"));
     </script>

     难度：
     <select class="form-control select-update" data-value="${param.nandu}" id="nandu" name="nandu">
      <option value="">请选择</option>
      <option value="难">难</option>
      <option value="中">中</option>
      <option value="易">易</option>
     </select>
     <script>
      $(".class_nandu6 select-update").val($(".class_nandu6 select-update").attr("data-value"));
     </script>

     <select class="form-control" name="orderby" id="orderby">
      <option value="id">按发布时间</option>
     </select>
     <select class="form-control" name="sort" id="sort">
      <option value="desc">倒序</option>
      <option value="asc">升序</option>
     </select>
     <script>
      $("#orderby").val("${orderby}");
      $("#sort").val("${sort}".toLocaleLowerCase());
     </script>
     <button type="submit" class="btn btn-default">搜索</button>

     <!--form标签结束-->
    </form>
   </div>

   <div class="list-table">
    <table width="100%" border="1" class="table table-list table-bordered table-hover">
     <thead>
     <tr align="center">
      <th width="60" data-field="item">序号</th>
      <th>试卷编号</th>
      <th>试卷名称</th>
      <th>所属科目</th>
      <th>课程名称</th>
      <th>章节名称</th>
      <th>发布人</th>
      <th>题目编号</th>
      <th>标题</th>
      <th>类型</th>
      <th>难度</th>
      <th>答案</th>

      <th width="220" data-field="handler">操作</th>
     </tr>
     </thead>
     <tbody>
     <c:set var="i" value="0" /><c:forEach items="${lists}" var="map"
     ><c:set var="i" value="${i+1}" />
      <tr id="${map.id}" pid="">
       <td width="30" align="center">
        <label> ${i} </label>
       </td>
       <td>${map.shijuanbianhao}</td>
       <td>${map.shijuanmingcheng}</td>
       <td><ssm:sql var="mapkemu4" type="find">SELECT kemumingcheng,id FROM kemu where id='${map.suoshukemu}'</ssm:sql>${mapkemu4.kemumingcheng}</td>
       <td>${map.kechengmingcheng}</td>
       <td>${map.zhangjiemingcheng}</td>
       <td>${map.faburen}</td>
       <td>${map.timubianhao}</td>
       <td>
        <pre style="padding: 5px; background: none; border: none; margin: 0">${map.biaoti}</pre>
       </td>
       <td>${map.leixing}</td>
       <td>${map.nandu}</td>
       <td>
        <script>
         (function () {
          try {
           var field = ${map.daan};
           $.each(field, function () {
            document.writeln(this.zimu + ' ' + this.title + ' 得分：' + this.point + '<br>');
           })
          } catch (e) {

          }
         })();
        </script>
       </td>

       <td align="center">
        <a class="btn btn-info btn-xs" href="shiti.do?ac=detail&id=${map.id}" title="详情"> 详情 </a>

        <a class="btn btn-success btn-xs" href="shiti.do?ac=updt&id=${map.id}" title="编辑"> 编辑 </a>

        <a class="btn btn-danger btn-xs" href="shiti.do?ac=delete&id=${map.id}" onclick="return confirm('确定删除？此操作不可恢复')" title="删除">
         删除
        </a>

        <!--qiatnalijne-->
       </td>
      </tr>
     </c:forEach>
     </tbody>
    </table>
   </div>

   <%@include file="/page.jsp" %>

  </div>
 </div>
</div>

<%@ include file="/foot.jsp" %>

